package cn.com.xiaoshoujia.quartz;

import cn.com.xiaoshoujia.activities.exception.ActivityException;
import cn.com.xiaoshoujia.wallet.activity.WalletActivity;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class SettlementErrorTask implements Job {

    Logger logger = LoggerFactory.getLogger(SettlementErrorTask.class);

    @Autowired
    WalletActivity walletActivity;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            walletActivity.settlement();
        } catch (ActivityException e) {
            logger.error(e.message);
        }
    }
}
